<html>
    <head>
        <title><g:layoutTitle default="Grails" /></title>
        <link rel="stylesheet" href="${resource(dir:'css',file:'main.css')}" />
        <link rel="shortcut icon" href="${resource(dir:'images',file:'favicon.ico')}" type="image/x-icon" />
        <g:layoutHead />
        <g:javascript library="application" />
        <style type="text/css" media="screen">

            #nav {
                margin-top:20px;
                margin-left:30px;
                width:228px;
                float:left;

            }
            .homePagePanel * {
                margin:0px;
            }
            .homePagePanel .panelBody ul {
                list-style-type:none;
                margin-bottom:10px;
            }
            .homePagePanel .panelBody h1 {
                text-transform:uppercase;
                font-size:1.1em;
                margin-bottom:10px;
            }
            .homePagePanel .panelBody {
                background: url(${resource(dir:'images',file:'leftnav_midstretch.png')}) repeat-y top;
                margin:0px;
                padding:15px;
            }
            .homePagePanel .panelBtm {
                background: url(${resource(dir:'images',file:'leftnav_btm.png')}) no-repeat top;
                height:20px;
                margin:0px;
            }

            .homePagePanel .panelTop {
                background: url(${resource(dir:'images',file:'leftnav_top.png')}) no-repeat top;
                height:11px;
                margin:0px;
            }
            h2 {
                margin-top:15px;
                margin-bottom:15px;
                font-size:1.2em;
            }
            #pageBody {
                margin-left:280px;
                margin-right:20px;
            }
        </style>
    </head>
    <body>
        <div id="spinner" class="spinner" style="display:none;">
            <img src="${resource(dir:'images',file:'spinner.gif')}" alt="Spinner" />
        </div>
        <div id="grailsLogo" class="logo"><a href="http://grails.org"><img src="${resource(dir:'images',file:'grails_logo.png')}" alt="Grails" border="0" /></a></div>
    <div id="nav">
        <div class="homePagePanel">
            <div class="panelTop">

            </div>
            <div class="panelBody">
                <h1>Zona publica</h1>
                <ul>
                    <li><a class="home" href="${createLink(uri: '/')}">Home</a></li>
                    <li><g:link controller="cine">Ver todas las peliculas</g:link> </li>
                </ul>
                <h1>Zona privada </h1>
                <ul>
                    <li><g:link controller="login">Login</g:link> </li>
                    <li><g:link controller="cine" action="porGenero">Peliculas por genero</g:link> </li>
                </ul>


	            <g:ifAllGranted role="ROLE_ADMIN">
                <h1>Zona administracion</h1>
                <ul>
                    <li><g:link controller="usuario">Usuarios</g:link> </li>
                    <li><g:link controller="role">Roles</g:link> </li>
                    <li><g:link controller="pelicula">Peliculas</g:link> </li>
                    <li><g:link controller="genero">Generos</g:link> </li>
                </ul>
                </g:ifAllGranted>
            </div>
            <div class="panelBtm">
            </div>
        </div>
        <g:isLoggedIn>
        <div class="homePagePanel">
            <div class="panelTop">

            </div>
            <div class="panelBody">
                <h1>Zona personal </h1>
                <p>Bienvenido <b><g:loggedInUserInfo field="email"/></b><br/><br/>
                </p>
                <ul>
                    <li><g:link controller="register">Mis datos</g:link> </li>
                    <li><g:link controller="logout">Cerrar sesion</g:link> </li>
                </ul>
            </div>
            <div class="panelBtm">
            </div>
        </div>
      </g:isLoggedIn>

    </div>
    <div id="pageBody">

        <g:layoutBody />



    </div>
    </body>
</html>